﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Kiosk.Library;

namespace Kiosk.UserControls
{
    /// <summary>
    /// Interaction logic for EmployeePresenter.xaml
    /// </summary>
    public partial class EmployeePresenter : UserControl
    {
        public event EventHandler<EventArgs> Close;
        public EmployeePresenter()
        {
            InitializeComponent();
        }

        private void ucImageButton_MouseUp(object sender, MouseButtonEventArgs e)
        {
            if (Close != null)
            { 
                Close(this, new EventArgs());
            }
        }

        private void UserControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            EmployeeInfo emp = (EmployeeInfo)this.DataContext;
            if (emp != null)
            {
                map.EndPoint = emp.LocationPoint;
                map.EndLocationName = emp.LocationName;
            }
        }
    }
}
